package org.dragonnova.meetingclient.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.Toast;

/**
 * Created by hucn on 2016/4/26.
 * Description:吐司工具类
 */
public class ToastUtil {

    private static Toast mToast;

    private static final boolean allowTipsShown = false;

    public static Toast getInstance() {
        return mToast;
    }

    @SuppressLint("ShowToast")
    public static void createSingleInstance(Context context) {
        if (mToast == null) mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    }

    public static void showTip(final String str) {
        if (allowTipsShown && mToast != null) {
            mToast.setText(str);
            mToast.show();
        }
    }
}
